package com.tyk.bookstore.back.task.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tyk.bookstore.back.task.model.enume.TaskState;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author tyk
 * @description 定时任务
 */
@Schema(name = "TaskDo", description = "定时任务")
@Data
@TableName("task")
public class TaskDo  implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;


    @Schema(description = "ID")
    @TableId(value = "id")
    private Long id;

    @Schema(description = "名称")
    @TableField("name")
    private String name;

    @Schema(description = "模块")
    @TableField("module")
    private String module;

    @Schema(description = "方法")
    @TableField("method")
    private String method;

    @Schema(description = "Cron表达式")
    @TableField("cron")
    private String cron;

    @Schema(description = "描述")
    @TableField("description")
    private String description;

    @Schema(description = "状态[0关闭,1开启]")
    @TableField("state")
    private TaskState state;

    @Schema(description = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;
}
